package com.hmkj.core.mapper.order;

import com.hmkj.common.baseMapper.GenericMapper;
import com.hmkj.core.model.order.OrderOperationModel;
import com.hmkj.core.po.order.OrderOperation;
import org.apache.ibatis.annotations.Select;

import java.util.List;
import java.util.Map;

/**
 * 操作日志表相关Dao接口<br>
 *
 * @author eproo
 * @date   2018-07-10 02:16:17
 */
public interface OrderOperationMapper extends GenericMapper< OrderOperation,Integer> {

    /**
     * 账户记录列表
     *
     * @param params
     * @return
     */
    @Select("SELECT t.* FROM biz_order_operation t LEFT JOIN biz_order o ON o.id = t.order_id WHERE 1 = 1 ${whereSql} ${sortSql} limit ${nowPage}, ${pageSize}")
    List<OrderOperationModel> findListBySqlJoin(Map<String, Object> params);

    /**
     * 统计
     * @param params
     * @return
     */
    @Select("SELECT count(1) FROM s_invest_account_log t LEFT JOIN biz_order o ON o.id = t.order_id WHERE 1 = 1 ${whereSql}")
    long countBySqlJoin(Map<String, Object> params);
}
